<?php
class TestController extends Controller {
	
	function AgencyAction()
	{
		$this->view("test.view","item");
	}
	
	function mainAction(){
		//$num = "803";
		//echo $this->conv($num);
		message_send('13880418125', '设备领取人:王菲,设备S/N:1,名称:京东自提Diy服务（安装、指导外加兼容性保证）');
	}
	
	
	function conv($num,$flg=true){
		$char = array("0"=>"零","1"=>"壹","2"=>"贰","3"=>"叁","4"=>"肆","5"=>"伍","6"=>"陆","7"=>"柒","8"=>"捌","9"=>"玖");
		$dw = array("1"=>"","2"=>"拾","3"=>"佰","4"=>"仟","5"=>"萬","6"=>"萬","7"=>"萬","8"=>"萬","9"=>"億","10"=>"億","11"=>"億","12"=>"億","13"=>"億","14"=>"兆");
		if(is_numeric($num)){
			if(strpos($num, ".")!==false){
				//echo "aa";
			}else{
				if($flg){
					$num = (int)$num;
				}
				return $this->conv($num,false).$dw[strlen($num)];
			}
		}else{
			return false;
		}
	}
}